<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/8/27
 * Time: 14:27
 */

namespace Model;

use Shop\Mypdo;

class IndexModel extends Mypdo{
    //查询分类和对应的商品
    public function getShop(){
        $arr=$this->pdo_sel("select * from s_class order by sort desc",2);
        $list=array();
        foreach ($arr as $v){
            $v['goods']=$this->pdo_sel("select * from s_goods where f_id = '{$v['id']}' and start=1 limit 6",2);
            $list[]=$v;
        }

        return $list;
    }

    //查询网站设置数据
    public function getW(){
        return $this->pdo_sel("select * from s_set limit 1");
    }
}